#ifndef SNFeatureEvaluator_h__
#define SNFeatureEvaluator_h__

#include "SNFeatureParams.h"

class SNFeatureEvaluator
{
public:
	SNFeatureEvaluator();
	~SNFeatureEvaluator();

	virtual void Init(const SNFeatureParams* feature_params, int max_sample_count, cv::Size win_size);

	virtual void SetImage(const cv::Mat& img, uchar cls_label, int idx);
	virtual void WriteFeatures(cv::FileStorage &fs, const cv::Mat& featureMap) const = 0;
	virtual float operator()(int featureIdx, int sampleIdx) const = 0;
	static cv::Ptr<SNFeatureEvaluator> Create(int type);

	int getNumFeatures() const { return NumFeatures; }
	int getMaxCatCount() const { return FeatureParams->MaxCatCount; }
	int getFeatureSize() const { return FeatureParams->FeatSize; }
	const cv::Mat& getCls() const { return cls; }
	float getCls(int si) const { return cls.at<float>(si, 0); }
protected:
	virtual void GenerateFeatures() = 0;

	int npos, nneg;
	int NumFeatures;
	cv::Size WinSize;
	SNFeatureParams* FeatureParams;
	cv::Mat cls;
};

#endif // SNFeatureEvaluator_h__

